/***
  Main.java is part of Marioneta.

  Marioneta is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License.

  Marioneta is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
  
  
  @author martin
   Martin Edmundo Barriga Orozco, 2008
   martin.barriga@gulmore.org
 */

package escritorioremoto;
import java.io.*;
import java.net.ServerSocket;

/**
 *
 * @author mbarriga
 */
public class Main {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        ServerSocket tmp;
        try{
            tmp = new ServerSocket(5000);
            tmp.close();
        }
        catch(IOException e){
            System.out.print("Puerto Abuerto...");
            System.exit(1); 
            
        }
        
        tmp = null;
        
        
        // TODO code application logic here
        int op = 0;
        System.out.print("MENU: \n\t1) Servidor\n\t2) Cliente \n\t3) Salir3\nOpcion: " );
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            op = Integer.parseInt( br.readLine() );
        }
        catch(IOException e){
            
        }
        switch(op){
            case 1:
                globalServer obj1 = new globalServer( );
                obj1.start();
                break;
            case 2:
                System.out.println("Direccion del server: ");
                try{
                    String toServer = br.readLine();
                    gui_cliente obj2 = new gui_cliente( toServer );
                }
                catch(IOException e){
                    
                }
                break;
            default:
                break;
        }
        
    }

}
